package com.cc.guavaeventbusdemo.component;

import com.cc.guavaeventbusdemo.domain.PatientAdmissionEvent;
import com.google.common.eventbus.Subscribe;

public class AlertNotifier {
    @Subscribe
    public void sendAlert(PatientAdmissionEvent event) {
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        System.out.println("[警报] 新患者入院：" + event.getPatientId() +"， 线程" + Thread.currentThread().getName());
    }
}
